package com.pkk.penguin.test.elasticsearch.entity;

import java.io.Serializable;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

/**
 * @description:
 * @author: peikunkun
 * @create: 2019-10-18 15:09
 **/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "articleindex", type = "article", refreshInterval = "-1")
public class Article implements Serializable {


  /**
   * 主键id
   */
  @Id
  private Long id;

  /**
   * 标题
   */
  //@Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
  @Field
  private String title;

  /**
   * 内容
   */
  //@Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
  @Field
  private String content;


  /**
   * 描述
   */
  @Field
  private String desc;


  /**
   * 评论
   */
  @Field
  private String comments;

}
